$OpenBSD: patch-slock_c,v 1.3 2016/08/13 14:00:00 tb Exp $
--- slock.c.orig	Fri Feb 12 20:29:02 2016
+++ slock.c	Sat Aug 13 15:37:49 2016
@@ -47,7 +47,7 @@ static Bool rr;
 static int rrevbase;
 static int rrerrbase;
 
-static void
+static void __attribute__((__noreturn__, __format__(printf, 1, 2)))
 die(const char *errstr, ...)
 {
 	va_list ap;
@@ -172,10 +172,12 @@ readpw(Display *dpy, const char *pws)
 				break;
 			case XK_Escape:
 				len = 0;
+				explicit_bzero(passwd, sizeof(passwd));
 				break;
 			case XK_BackSpace:
 				if (len)
 					--len;
+				explicit_bzero(passwd + len, 1);
 				break;
 			default:
 				if (num && !iscntrl((int)buf[0]) && (len + num < sizeof(passwd))) {
@@ -185,6 +187,7 @@ readpw(Display *dpy, const char *pws)
 				break;
 			}
 			color = len ? INPUT : (failure || failonclear ? FAILED : INIT);
+			explicit_bzero(buf, sizeof(buf));
 			if (running && oldc != color) {
 				for (screen = 0; screen < nscreens; screen++) {
 					XSetWindowBackground(dpy, locks[screen]->win, locks[screen]->colors[color]);
